/*
 * Copyright (c) 2020 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.andkulikov.transitionseverywhere.slice;

import com.transitionseverywhere.*;
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;
import ohos.agp.components.*;
import ohos.utils.LightweightMap;
import com.andkulikov.transitionseverywhere.ResourceTable;

import java.util.ArrayList;

public class SceneSample extends AbilitySlice implements RadioContainer.CheckedStateChangedListener{

    private Scene mScene1;
    private Scene mScene2;
    private Scene mScene3;
    DirectionalLayout dir;
    StackLayout mSceneRoot;

    private TransitionManager mTransitionManagerForScene3;



    @Override
    protected void onStart(Intent intent) {
        super.onStart(intent);
        ComponentContainer layout = (ComponentContainer) LayoutScatter.getInstance(this).
                parse(ResourceTable.Layout_slice_Scene, null, false);
        dir = (DirectionalLayout) layout.findComponentById(ResourceTable.Id_plLayoutRoot);
        Object tagMap = new LightweightMap<String, ArrayList<Transition>>();
        dir.setTag(tagMap);

        RadioContainer radioContainer = (RadioContainer)layout.findComponentById(ResourceTable.Id_select_scene);
        radioContainer.setMarkChangedListener(this::onCheckedChanged);
        mSceneRoot = (StackLayout) layout.findComponentById(ResourceTable.Id_select_root);

        super.setUIContent(layout);
    }


    @Override
    public void onCheckedChanged(RadioContainer radioContainer, int i) {

    }
}
